<?php

namespace App\Validate;

use App\Validate\BaseValidate;

/**
 *
 */
class ResourceSystemTypeIntentionValidate extends BaseValidate
{
    //验证规则
    protected $rule = [
        'id' => 'bail|required|integer',
        'resource_ids' => 'bail|required',
        'resource_list_ids' => 'bail|required',
        'resource_system_type_id' => 'bail|required|integer',

        'type' => 'bail|required|in:1,2',
    ];
    //自定义验证信息
    protected $message = [
        'id.required' => 'ID不能为空',
        'id.integer' => 'ID格式不正确',
        'resource_ids.required' => '资源ID不能为空',
        'resource_list_ids.required' => '数据ID不能为空',
        'resource_system_type_id.required' => '资源类型ID不能为空',
        'resource_system_type_id.integer' => '资源类型ID格式不正确',

        'type.required' => '类型不能为空',
        'type.in' => '类型规则不正确',
    ];

    //自定义场景
    protected $scene = [
        'lists' => ['resource_system_type_id'], //列表
        'add' => ['resource_system_type_id', 'resource_ids'], //添加
        'del' => ['resource_system_type_id', 'resource_list_ids'], //删除

        'get_big_type_id_by_system_type_id' => ['resource_system_type_id'], //根据资源类型获取资源大类id

        //'get_resource_total_type_list_book_data' => ['type'], //获取数据

    ];
}
